package com.xli.sso.current.user.entity.mapper;

import com.xli.sso.current.user.entity.CurrentUserVO;
import com.xli.sso.security.identity.LoginUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;


@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ICurrentUserMapper {

    ICurrentUserMapper INSTANCE = Mappers.getMapper(ICurrentUserMapper.class);

    @Mappings({
            @Mapping(source = "loginId", target = "loginId"),
            @Mapping(source = "username", target = "username"),
            @Mapping(source = "mobile", target = "mobile"),
            @Mapping(source = "avatar", target = "avatar")})
    CurrentUserVO toVO(LoginUser loginUser);

}
